<template>
  <el-form
    ref="userForm"
    :model="userInfo"
    label-width="120px"
    style="margin-left: 120px; margin-top: 30px"
  >
    <el-form-item label="姓名:">
<<<<<<< HEAD
      <el-input v-model="userInfo.username" style="width: 300px" />
    </el-form-item>
    <el-form-item label="密码:">
      <el-input
        v-model="userInfo.password"
        type="password"
        style="width: 300px"
      />
=======
      <el-input v-model="userInfo.username" style="width:300px" />
    </el-form-item>
    <el-form-item label="密码:">
      <el-input v-model="userInfo.password" type="password" style="width:300px" />
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="update">更新</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
import { getuserimg } from '@/api/user'
<<<<<<< HEAD
import { updateById } from '@/api/employees'
=======
import { updateMenus } from '@/api/employees'
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
export default {
  data() {
    return {
      userInfo: {
        username: '',
        password: ''
      }
    }
  },
  created() {
<<<<<<< HEAD
    this.getinfo()
  },
  methods: {
    async update() {
      const data = await updateById(this.userInfo)
      console.log(data)
    },
    async getinfo() {
      const { data: res } = await getuserimg(this.$route.query.id)
      console.log(res)
      this.userInfo = res
=======
    this.getlist()
  },
  methods: {
    async getlist() {
      const { data: res } = await getuserimg(this.$route.query.id)
      console.log(res)
      this.userInfo = res
    },
    async  update() {
      const { data: res } = await updateMenus(this.userInfo)
      console.log(res)
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
    }
  }
}
</script>
